'''
例如方程：
    3x+4y−2z=7
    4x+y+3z=6
    x+y+7z=5
'''
import sympy as sp
import numpy as np
# 满秩有唯一解
# 非齐次满秩只有零解

# numpy更方便些
a=np.array([[3,4,-2],[4,1,3],[1,1,7]])
b=np.array([7,6,5]).T
x=np.linalg.solve(a,b)
print(x)

# sympy
a = sp.Matrix([[3,4,-2],[4,1,3],[1,1,7]])
b = sp.Matrix([[7],[6],[5]])
x,y,z=sp.symbols('x y z')
x0=sp.Matrix([x,y,z])
res=sp.solve(a*x0-b)
print(res)
